<template>
   <el-card>
      <!-- 合同管理 -->
      <bread-crumb slot="header">
        <template slot="title">合同管理</template>
      </bread-crumb>
      <div class="Contaner">
          <div class="QueryBtn">
            <el-select v-model="value" placeholder="请选择" style=" width: 170px;">
              <el-option
              style="height: 40px;"
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
            <el-input v-model="input" placeholder="请输入内容" style="width: 210px;margin-left: 20px;"></el-input>
            <!-- <div style="margin-left: 20px;">
              地区：<el-cascader v-model="value" :options="options" @change="handleChange"></el-cascader>
            </div> -->
            <el-button style="margin-left: 20px; height: 25px; line-height: 3px;" type="primary">查询</el-button>
          </div>
        <el-tabs type="border-card" @tab-click="handleClick" v-model="activeName">
          <el-tab-pane label="全部" name="1" >
              <el-table :header-cell-style="{ background: '#eee', color: '#606266' }" :data="tableData"  max-height="450" style="width: 100%" >
                <el-table-column prop="servicesName" label="所属机构" ></el-table-column>
                <el-table-column label="合同" >
                    <!-- @click="exportBouncedsssss = true" -->

                  <template slot-scope="{row}">
                    <el-button
                      type="text"
                      size="small">
                      {{row.name}}
                    </el-button>
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="内容说明" ></el-table-column>
                <el-table-column  label="状态" >
                  <template slot-scope="{row}">
                      {{row.status==1?'使用中':'已注销'}}
                  </template></el-table-column>
                <el-table-column  label="合同使用时间" >
                  <template slot-scope="{row}">
                      {{formatTime(row.useStartDate*1000)}}
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="备注" ></el-table-column>
                <!-- <el-table-column prop="Institutional" label="地区" width="140%"></el-table-column> -->
              </el-table>
              <!-- 分页 -->
                <el-row
                  type="flex"
                  align="middle"
                  justify="center"
                  style="margin-top: 20px"
                >
                  <el-col :span="5">
                    <el-pagination
                      background
                      layout="total, prev, pager, next, sizes"
                      :total="page.total"
                      :page-sizes="[7, 10, 20, 50, 100]"
                      :page-size="page.pageSize"
                      @current-change="changePage"
                      @size-change="handleSizeChange"
                      :current-page.sync="page.currentPage"
                    ></el-pagination>
                  </el-col>
                </el-row>
          </el-tab-pane>
          <el-tab-pane label="已停用"  name="2" >
              <el-table :header-cell-style="{ background: '#eee', color: '#606266' }" :data="tableData"  max-height="450" style="width: 100%">
                <el-table-column prop="servicesName" label="所属机构" width="210%"></el-table-column>
                <el-table-column label="合同" width="140%">
                  <template slot-scope="{row}">
                    <el-button
                    @click="exportBouncedsssss = true"
                      type="text"
                      size="small">
                      {{row.name}}
                    </el-button>
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="内容说明" width="180%"></el-table-column>
                <el-table-column  label="状态" width="150%">
                  <template slot-scope="{row}">
                      {{row.status==1?'使用中':'已注销'}}
                  </template></el-table-column>
                <el-table-column  label="合同使用时间" width="310%">
                  <template slot-scope="{row}">
                      {{formatTime(row.useStartDate*1000)}}
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="备注" width="140%"></el-table-column>
              </el-table>
              <!-- 分页 -->
                <el-row
                  type="flex"
                  align="middle"
                  justify="center"
                  style="margin-top: 20px"
                >
                  <el-col :span="5">
                    <el-pagination
                      background
                      layout="total, prev, pager, next, sizes"
                      :total="page.total"
                      :page-sizes="[7, 10, 20, 50, 100]"
                      :page-size="page.pageSize"
                      @current-change="changePage"
                      @size-change="handleSizeChange"
                      :current-page.sync="page.currentPage"
                    ></el-pagination>
                  </el-col>
                </el-row>
          </el-tab-pane>
          <el-tab-pane label="使用中"  name="3" >
              <el-table :header-cell-style="{ background: '#eee', color: '#606266' }" :data="tableData"  max-height="450" style="width: 100%">
               <el-table-column prop="servicesName" label="所属机构" width="210%"></el-table-column>
                <el-table-column label="合同" width="140%">
                  <template slot-scope="{row}">
                    <el-button
                    @click="exportBouncedsssss = true"
                      type="text"
                      size="small">
                      {{row.name}}
                    </el-button>
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="内容说明" width="180%"></el-table-column>
                <el-table-column  label="状态" width="150%">
                  <template slot-scope="{row}">
                      {{row.status==1?'使用中':'已注销'}}
                  </template></el-table-column>
                <el-table-column  label="合同使用时间" width="310%">
                  <template slot-scope="{row}">
                      {{formatTime(row.useStartDate*1000)}}
                  </template>
                </el-table-column>
                <el-table-column prop="details" label="备注" width="140%"></el-table-column>
              </el-table>
              <!-- 分页 -->
                <el-row
                  type="flex"
                  align="middle"
                  justify="center"
                  style="margin-top: 20px"
                >
                  <el-col :span="5">
                    <el-pagination
                      background
                      layout="total, prev, pager, next, sizes"
                      :total="page.total"
                      :page-sizes="[7, 10, 20, 50, 100]"
                      :page-size="page.pageSize"
                      @current-change="changePage"
                      @size-change="handleSizeChange"
                      :current-page.sync="page.currentPage"
                    ></el-pagination>
                  </el-col>
                </el-row>
          </el-tab-pane>
        </el-tabs>
      </div>
      <!-- 详细信息 -->
      <el-dialog title="详细信息" width="600px" :visible.sync="exportBouncedsssss">
        <div class="big_Info"><div>教师名称：</div><div style="margin-left: 2px;">厉害陈老师</div></div>
        <div class="big_Info"><div>身份证件类型：</div><div style="margin-left: 2px;">居民身份证</div></div>
        <div class="big_Info"><div>身份证件号码：</div><div style="margin-left: 2px;">210882199952568443</div></div>
        <div class="big_Info"><div>教师资格种类：</div><div style="margin-left: 2px;">高级中学教师资格证</div></div>
        <div class="big_Info"><div>任教学科：</div><div style="margin-left: 2px;">历史与社会</div></div>
        <div class="big_Info"><div>情况说明：</div><div style="margin-left: 2px;">历史老师</div></div>
        <div class="big_Info"><div>证明材料：</div><div style="margin-left: 2px;"><el-button type="text" style="height: 10px; padding: 0;">点击查看</el-button></div></div>
        <div class="big_Info"><div>教师头像：</div><div style="margin-left: 2px;"></div></div>
      </el-dialog>
   </el-card>
</template>

<script>
import { listContract } from '@/api'
export default {
  data () {
    return {
      activeName: '1',
      exportBouncedsssss: false,
      exportBounced: false,
      exportBouncedsss: false,
      optionsskc: [{
        value: '选项1',
        label: '初级中学教师资格证'
      }, {
        value: '选项2',
        label: '高级中学教师资格证'
      }, {
        value: '选项3',
        label: '小学教师资格证'
      }, {
        value: '选项4',
        label: '高等学校教师资格证'
      }],
      options: [{
        value: '姓名',
        label: '姓名'
      }, {
        value: '身份证号码',
        label: '身份证号码'
      }, {
        value: '教师资格证号',
        label: '教师资格证号'
      }, {
        value: '所属机构',
        label: '所属机构'
      }],
      value: '',
      value1: '',
      page: {
        // 分页数据
        total: 1, // 总条数
        currentPage: 1, // 默认的页码 是第一个页  决定了当前页码是第几页
        pageSize: 10 // page-size的默认值是10条
      },
      tableData: []
    }
  },
  created () {
    this.getContractList()
  },
  methods: {
    // 当选择项发生变化时会触发该事件
    handleSelectionChange (val) {
      console.log('我选择了')
      console.log(val)
      this.multipleSelection = val
    },
    async getContractList () {
      var params = {}
      const ser = await listContract(params)
      console.log(ser)
      if (ser?.code === 200) {
        const { list, total } = ser?.data
        console.log('大数组的数据', list)
        this.tableData = list
        this.page.total = total
      }
    },
    // 格式化 毫秒级时间戳 1637338090875
    formatTime (item) {
      return this.$formatTime(item)
    },
    handleClick (tab, event) {
      console.log(tab.name)
    }
  }
}
</script>

<style lang="less" scopde>
  .Selectionsss {
    padding-top: 10px;
    padding-bottom: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .left_btn {

      .el-button+.el-button {
        margin-left: 0;
    }
      }
  }
  .big_Info {
    display: flex;
    padding: 0 24px 16px;
    color: rgba(0,0,0,.85);
  }
.Top_seach {
  .tabelskc {
    display: flex;
      margin-bottom: 24px;
    .shuru {
      width: 100%;
    }
    .left_name {
      width: 180px;
      height: 32px;
      text-align: right;
      line-height: 32px;
    }
  }
      .blocksss {
      padding: 0 0 0 75px;
      margin-bottom: 24px;
    }
  .category {
    padding: 0 0 0 20px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    .checkboxs {
      width: 500px;
      display: flex;
      flex-wrap: wrap;
      .el-checkbox {
        margin-right: 15px;
      }
    }
  }
  p {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 20px;
    color: #000000;
  }
}
  .ExportBtn {
    width: 80%;
    margin: 0px 40px 0px;
    padding-bottom: 40px;
  }
  .el-card__body {
    padding: 0 !important;

      .el-dialog {
    margin-bottom: 0 !important;
  }

  .el-dialog__body {
    padding: 30px 20px 0;
    border-top: 1px solid #e4e4e4;
  }
  }
  .Contaner {
    position: relative;
  }
  .QueryBtn {
    display: flex;
    align-items: center;
    width: 810px;
    height: 40px;
    position: absolute;
    top: 0;
    right: 30px;
    z-index: 1;
    .el-input__suffix {
      line-height: 50px;
    }
    input {
      height: 30px;
    }
  }
</style>
